<?
function get_town_name($town_id)
{
	$CI =& get_instance(); 
	$CI->db->select('town_name') ;
	$CI->db->where('town_id', $town_id) ;
	$CI->db->order_by('sort_no', 'ASC') ;
	$rs =  $CI->db->get('town')->row(); 
	if(count($rs) >0)
		return $rs->town_name ;
	else
		return 'Tat Ca' ;
}
function get_list_town()
{
	$CI =& get_instance(); 
	$CI->db->select('town_id, town_name') ;
	$CI->db->order_by('sort_no', 'ASC') ;
	$rs =  $CI->db->get('town')->result(); 
	return $rs ;
}
function get_list_class()
{
	$CI =& get_instance(); 
	$CI->db->select('class_id, class_name') ;
	$CI->db->order_by('sort_no', 'ASC') ;
	$rs =  $CI->db->get('class')->result(); 
	return $rs ;
}

?>